<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">

	<ui:define name="body">
		<h1>Nova Solicitação</h1>
		<h:form id="solicitacaomudanca" styleClass="edit">

			<rich:panel>
				<f:facet name="header">Nova Solicitação de Mudanca</f:facet>

				<s:decorate id="descricaoField" template="layout/edit.xhtml">
					<ui:define name="label">Descrição da Mudança</ui:define>
					<h:inputTextarea id="descricao" cols="80" rows="3" required="true"
						value="#{solicitacaomudancaHome.instance.descricao}" />
				</s:decorate>


				<s:decorate id="justificativaField" template="layout/edit.xhtml">
					<ui:define name="label">Justificativa Aprovação/Reprovação</ui:define>
					<h:inputTextarea id="justificativa" cols="80" rows="3"
						value="#{solicitacaomudancaHome.instance.justificativa}" />
				</s:decorate>


				<s:decorate id="tituloField" template="layout/edit.xhtml">
					<ui:define name="label">Título</ui:define>
					<h:inputTextarea id="titulo" cols="80" rows="3" required="true"
						value="#{solicitacaomudancaHome.instance.titulo}" />
				</s:decorate>

				<div style="clear: both">
					<span class="required">*</span> required fields
				</div>

			</rich:panel>

			<div class="actionButtons">

				<h:commandButton id="save" value="Salvar"
					action="#{solicitacaomudancaHome.persist}"
					disabled="#{!solicitacaomudancaHome.wired}"
					rendered="#{!solicitacaomudancaHome.managed}" />

				<s:button id="cancelAdd" value="Cancelar" propagation="end"
					view="/#{empty solicitacaomudancaFrom ? 'SolicitacaomudancaList' : solicitacaomudancaFrom}.xhtml"
					rendered="#{!solicitacaomudancaHome.managed}" />

			</div>
		</h:form>

		<rich:tabPanel switchType="ajax">

			<rich:tab label="Statusmudanca *" labelClass="required">
				<div class="association" id="statusmudancaParent">

					<h:outputText
						value="There is no statusmudanca associated with this solicitacaomudanca."
						rendered="#{solicitacaomudancaHome.instance.statusmudanca == null}" />

					<rich:dataTable var="_statusmudanca"
						value="#{solicitacaomudancaHome.instance.statusmudanca}"
						rendered="#{solicitacaomudancaHome.instance.statusmudanca != null}"
						rowClasses="rvgRowOne,rvgRowTwo" id="statusmudancaTable">
						<h:column>
							<f:facet name="header">Id</f:facet>
							<h:outputText value="#{_statusmudanca.id}" />
						</h:column>
						<h:column>
							<f:facet name="header">Nome</f:facet>
							<h:outputText value="#{_statusmudanca.nome}" />
						</h:column>
					</rich:dataTable>

					<div class="actionButtons">
						<s:button
							id="#{solicitacaomudancaHome.instance.statusmudanca != null ? 'changeParent' : 'selectParent1'}"
							value="#{solicitacaomudancaHome.instance.statusmudanca != null ? 'Change' : 'Select'} statusmudanca"
							view="/StatusmudancaList.xhtml">
							<f:param name="from" value="SolicitacaomudancaEdit" />
						</s:button>
					</div>

				</div>
			</rich:tab>

			<rich:tab label="Projeto *" labelClass="required">
				<div class="association" id="projetoParent">

					<h:outputText
						value="There is no projeto associated with this solicitacaomudanca."
						rendered="#{solicitacaomudancaHome.instance.projeto == null}" />

					<rich:dataTable var="_projeto"
						value="#{solicitacaomudancaHome.instance.projeto}"
						rendered="#{solicitacaomudancaHome.instance.projeto != null}"
						rowClasses="rvgRowOne,rvgRowTwo" id="projetoTable">
						<h:column>
							<f:facet name="header">Id</f:facet>
							<h:outputText value="#{_projeto.id}" />
						</h:column>
						<h:column>
							<f:facet name="header">Statusprojeto id</f:facet>
							<h:outputText value="#{_projeto.statusprojeto.id}" />
						</h:column>
						<h:column>
							<f:facet name="header">Usuario id</f:facet>
							<h:outputText value="#{_projeto.usuario.id}" />
						</h:column>
						<h:column>
							<f:facet name="header">Cliente</f:facet>
							<h:outputText value="#{_projeto.cliente}" />
						</h:column>
						<h:column>
							<f:facet name="header">Custoprevisto</f:facet>
							<h:outputText value="#{_projeto.custoprevisto}" />
						</h:column>
						<h:column>
							<f:facet name="header">Datacriacao</f:facet>
							<h:outputText value="#{_projeto.datacriacao}">
								<s:convertDateTime type="both" dateStyle="short" />
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">Fim</f:facet>
							<h:outputText value="#{_projeto.fim}">
								<s:convertDateTime type="both" dateStyle="short" />
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">Fimprevisto</f:facet>
							<h:outputText value="#{_projeto.fimprevisto}">
								<s:convertDateTime type="both" dateStyle="short" />
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">Inicio</f:facet>
							<h:outputText value="#{_projeto.inicio}">
								<s:convertDateTime type="both" dateStyle="short" />
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">Justificativa</f:facet>
							<h:outputText value="#{_projeto.justificativa}" />
						</h:column>
						<h:column>
							<f:facet name="header">Necessidades</f:facet>
							<h:outputText value="#{_projeto.necessidades}" />
						</h:column>
						<h:column>
							<f:facet name="header">Nome</f:facet>
							<h:outputText value="#{_projeto.nome}" />
						</h:column>
						<h:column>
							<f:facet name="header">Orcamento</f:facet>
							<h:outputText value="#{_projeto.orcamento}" />
						</h:column>
						<h:column>
							<f:facet name="header">Premissas</f:facet>
							<h:outputText value="#{_projeto.premissas}" />
						</h:column>
						<h:column>
							<f:facet name="header">Produto</f:facet>
							<h:outputText value="#{_projeto.produto}" />
						</h:column>
						<h:column>
							<f:facet name="header">Responsabilidadesgp</f:facet>
							<h:outputText value="#{_projeto.responsabilidadesgp}" />
						</h:column>
						<h:column>
							<f:facet name="header">Restricoes</f:facet>
							<h:outputText value="#{_projeto.restricoes}" />
						</h:column>
						<h:column>
							<f:facet name="header">Resumo</f:facet>
							<h:outputText value="#{_projeto.resumo}" />
						</h:column>
					</rich:dataTable>

					<div class="actionButtons">
						<s:button
							id="#{solicitacaomudancaHome.instance.projeto != null ? 'changeParent' : 'selectParent'}"
							value="#{solicitacaomudancaHome.instance.projeto != null ? 'Change' : 'Select'} projeto"
							view="/ProjetoList.xhtml">
							<f:param name="from" value="SolicitacaomudancaEdit" />
						</s:button>
					</div>

				</div>
			</rich:tab>

			<rich:tab label="Usuario *" labelClass="required">
				<div class="association" id="usuarioParent">

					<h:outputText
						value="There is no usuario associated with this solicitacaomudanca."
						rendered="#{solicitacaomudancaHome.instance.usuario == null}" />

					<rich:dataTable var="_usuario"
						value="#{solicitacaomudancaHome.instance.usuario}"
						rendered="#{solicitacaomudancaHome.instance.usuario != null}"
						rowClasses="rvgRowOne,rvgRowTwo" id="usuarioTable">
						<h:column>
							<f:facet name="header">Id</f:facet>
							<h:outputText value="#{_usuario.id}" />
						</h:column>
						<h:column>
							<f:facet name="header">Ddd</f:facet>
							<h:outputText value="#{_usuario.ddd}" />
						</h:column>
						<h:column>
							<f:facet name="header">Email</f:facet>
							<h:outputText value="#{_usuario.email}" />
						</h:column>
						<h:column>
							<f:facet name="header">Endereco</f:facet>
							<h:outputText value="#{_usuario.endereco}" />
						</h:column>
						<h:column>
							<f:facet name="header">Gp</f:facet>
							<h:outputText value="#{_usuario.gp}" />
						</h:column>
						<h:column>
							<f:facet name="header">Login</f:facet>
							<h:outputText value="#{_usuario.login}" />
						</h:column>
						<h:column>
							<f:facet name="header">Nome</f:facet>
							<h:outputText value="#{_usuario.nome}" />
						</h:column>
						<h:column>
							<f:facet name="header">Senha</f:facet>
							<h:outputText value="#{_usuario.senha}" />
						</h:column>
						<h:column>
							<f:facet name="header">Telefone</f:facet>
							<h:outputText value="#{_usuario.telefone}" />
						</h:column>
					</rich:dataTable>

					<div class="actionButtons">
						<s:button
							id="#{solicitacaomudancaHome.instance.usuario != null ? 'changeParent' : 'selectParent2'}"
							value="#{solicitacaomudancaHome.instance.usuario != null ? 'Change' : 'Select'} usuario"
							view="/UsuarioList.xhtml">
							<f:param name="from" value="SolicitacaomudancaEdit" />
						</s:button>
					</div>

				</div>
			</rich:tab>
		</rich:tabPanel>
	</ui:define>

</ui:composition>
